package com.atguigu.spzx.feign.product;

import com.atguigu.spzx.model.dto.product.SkuSaleDto;
import com.atguigu.spzx.model.entity.product.ProductSku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

/**
 * ClassName: ProductFeignClient
 * Package: com.atguigu.spzx.feign.product
 * Description:
 *
 * @Author 刘强
 * @Create 2024/7/17 9:54
 * @Version 1.0
 */
@FeignClient(value = "service-product")
public interface ProductFeignClient {

    /**
     * /api/product
     * 跟新库存和销量 -> 库存减少，销量增加
     */
    @GetMapping("updateStockAndSaleNum")
    public void updateStockAndSaleNum(List<SkuSaleDto> skuSaleDtoList);

    /** /api/product/getBySkuId/{skuId}
     * 根据skuId获取sku
     * @param skuId
     * @return
     */
    @GetMapping("/api/product/getBySkuId/{skuId}")
    public ProductSku getBySkuId(@PathVariable Long skuId);
}
